#include <iostream>
#include <algorithm>
using namespace std;
int count1=0,n;
int find(int a[],int goal)
{
	int head=0,end=n-1;
	while(head<=end)
	{
		int mid=(head+end)/2;
		count1++;
		if(a[mid]>goal) end=mid-1;
		else if(a[mid]<goal) head=mid+1;
		else return mid;
		
	}
	return -1;
}
int main()
{
	int a[1000],x,i;
	cin>>n;
	for(i=0;i<n;i++)
		cin>>a[i];
	cin>>x;
	int ans=find(a,x);
	cout<<ans<<endl<<count1;
	return 0;
}